{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pregnants</th>\n",
       "      <th>Plasma_glucose_concentration</th>\n",
       "      <th>blood_pressure</th>\n",
       "      <th>Triceps_skin_fold_thickness</th>\n",
       "      <th>serum_insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>Diabetes_pedigree_function</th>\n",
       "      <th>Age</th>\n",
       "      <th>Target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.639947</td>\n",
       "      <td>0.866045</td>\n",
       "      <td>-0.031990</td>\n",
       "      <td>0.670643</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>0.166619</td>\n",
       "      <td>0.468492</td>\n",
       "      <td>1.425995</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.844885</td>\n",
       "      <td>-1.205066</td>\n",
       "      <td>-0.528319</td>\n",
       "      <td>-0.012301</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>-0.852200</td>\n",
       "      <td>-0.365061</td>\n",
       "      <td>-0.190672</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.233880</td>\n",
       "      <td>2.016662</td>\n",
       "      <td>-0.693761</td>\n",
       "      <td>-0.012301</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>-1.332500</td>\n",
       "      <td>0.604397</td>\n",
       "      <td>-0.105584</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.844885</td>\n",
       "      <td>-1.073567</td>\n",
       "      <td>-0.528319</td>\n",
       "      <td>-0.695245</td>\n",
       "      <td>-0.540642</td>\n",
       "      <td>-0.633881</td>\n",
       "      <td>-0.920763</td>\n",
       "      <td>-1.041549</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-1.141852</td>\n",
       "      <td>0.504422</td>\n",
       "      <td>-2.679076</td>\n",
       "      <td>0.670643</td>\n",
       "      <td>0.316566</td>\n",
       "      <td>1.549303</td>\n",
       "      <td>5.484909</td>\n",
       "      <td>-0.020496</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   pregnants  Plasma_glucose_concentration  blood_pressure  \\\n",
       "0   0.639947                      0.866045       -0.031990   \n",
       "1  -0.844885                     -1.205066       -0.528319   \n",
       "2   1.233880                      2.016662       -0.693761   \n",
       "3  -0.844885                     -1.073567       -0.528319   \n",
       "4  -1.141852                      0.504422       -2.679076   \n",
       "\n",
       "   Triceps_skin_fold_thickness  serum_insulin       BMI  \\\n",
       "0                     0.670643      -0.181541  0.166619   \n",
       "1                    -0.012301      -0.181541 -0.852200   \n",
       "2                    -0.012301      -0.181541 -1.332500   \n",
       "3                    -0.695245      -0.540642 -0.633881   \n",
       "4                     0.670643       0.316566  1.549303   \n",
       "\n",
       "   Diabetes_pedigree_function       Age  Target  \n",
       "0                    0.468492  1.425995       1  \n",
       "1                   -0.365061 -0.190672       0  \n",
       "2                    0.604397 -0.105584       1  \n",
       "3                   -0.920763 -1.041549       0  \n",
       "4                    5.484909 -0.020496       1  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np  \n",
    "import pandas as pd \n",
    "\n",
    "import matplotlib.pyplot as plt   \n",
    "import seaborn as sns\n",
    "\n",
    "df = pd.read_csv(\"/Users/wuhuan/Desktop/FE_pima-indians-diabetes.csv\")\n",
    "df.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从原始数据中分离输入特征x和输出y\n",
    "y = df[\"Target\"]\n",
    "X = df.drop([\"Target\"], axis = 1)\n",
    "#特征名称，用于后续显示权重系数对应的特征\n",
    "feat_names = X.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is:  [0.48797856 0.53011593 0.4562292  0.422546   0.48392885]\n",
      "cv logloss is: 0.47615970944434044\n"
     ]
    }
   ],
   "source": [
    "#log似然损失评估\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "lr=LogisticRegression(solver='liblinear')\n",
    "\n",
    "from sklearn.model_selection import cross_val_score\n",
    "loss = cross_val_score(lr, X, y, cv=5, scoring='neg_log_loss')\n",
    "print ('logloss of each fold is: ',-loss)\n",
    "print ('cv logloss is:', -loss.mean())\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4760256384440807\n",
      "{'C': 1, 'penalty': 'l1'}\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression(solver='liblinear')\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X,y)\n",
    "\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "说明在log似然损失下，最佳的超参数C=1，且此时的得分为0.476，这个结果优于未设置正则项的结果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/wuhuan/anaconda3/envs/OpenCV/lib/python3.6/site-packages/sklearn/utils/deprecation.py:125: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/Users/wuhuan/anaconda3/envs/OpenCV/lib/python3.6/site-packages/sklearn/utils/deprecation.py:125: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl4VOXZx/HvnY0ECHtYQwIiqOxIhOBWV4hLXcAFBar2tVartauttlbrUrXt+7a2FlvUaq2iaN1K3XCvirIEZJFFRRQJi2DY1yxzv3/MgDEGZrIMJzP5fa7rXDnnzHNmfofo3Dnb85i7IyIisj8pQQcQEZHGT8VCRESiUrEQEZGoVCxERCQqFQsREYlKxUJERKJSsRARkahULEREJCoVCxERiSot6AANpUOHDt6jR4+gY4iIJJQ5c+Z84e450drFtViYWRHwJyAVuM/d76j2+h+B4yOLzYGO7t4m8tpFwPWR12519wf391k9evSguLi4IeOLiCQ9M1sRS7u4FQszSwUmAicDJcBsM5vq7ov3tHH3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JygE3APHcfFWyq2JnZqcCdQCpwv7v/JuBIdWZmjwLHEe7h9HPgRnf/e6Ch6sDMjgbeAhYS/v8d4Bfu/nxwqerGzAYCDxL+7ysFeNzdb47LZ6lYiIhINDoNJSIiUalYiIhIVCoWIiISlYqFiIhEpWIhIiJRqViI1IKZbYvear/bP2FmB0XmW5rZJDP7ONJj6JtmNtzMMiLzTeqhWWncVCxEDhAz6wekuvvyyKr7CHfM19vd+wEXAx0inQ6+CpwfSFCRGqhYiNSBhf0+0ofVQjM7P7I+xczujhwpPGtmz5vZOZHNxgH/jrTrBQwHrnf3EECkd9rnIm2fibQXaRR0mCtSN6OBwcAgwk80zzazN4GjgB7AAKAj4e6v749scxTwaGS+H+Gn0Sv38f7vA0fEJblIHejIQqRujgYejfT4+TnwX8Jf7kcD/3L3kLuvBV6vsk0XYH0sbx4pImWRwXlEAqdiIVI3NXU/vr/1ADuBzMj8ImCQme3v/8FmwK46ZBNpcCoWInXzJnB+ZOCZHOBYYBbhYS3HRK5ddCLc8d4eS4CDAdz9Y6AYuCnSCypm1nvPGB5m1h5Y7+7lB2qHRPZHxUKkbp4GFgDzgdeAn0VOOz1JeByL9wmPGz4T2BzZ5jm+WjwuBToDy8xsIXAvX453cTyQcL2gSvJSr7MiDczMWrr7tsjRwSzgKHdfGxlv4PXI8r4ubO95j6eA6xJ4/HFJMrobSqThPRsZkCYDuCVyxIG77zSzGwmPw/3ZvjaODJT0jAqFNCY6shARkah0zUJERKJSsRARkahULEREJCoVCxERiUrFQkREolKxEBGRqP4flrJ5mXTVD8EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    plt.errorbar(x_axis, -test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    #plt.errorbar(x_axis, -train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "plt.legend()\n",
    "plt.xlabel( 'log(C)' )                                                                                                      \n",
    "plt.ylabel( 'logloss' )\n",
    "plt.savefig('LogisticGridSearchCV_C.png' )\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "图像显示了L1，L2正则下，模型得分随着超参数的变化曲线，由此可知，L1，L2正则模型随着超参数的增大，模型效果越来越好，当超参数增大到1以后，两种正则的效果几乎相同，但L1正则随超参数变化的优化效果更好。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.7747395833333334\n",
      "{'C': 0.1, 'penalty': 'l2'}\n"
     ]
    }
   ],
   "source": [
    "#正确率评估\n",
    "lr_penalty= LogisticRegression(solver='liblinear')\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5)\n",
    "grid.fit(X,y)\n",
    "\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "以正确率作为指标对超参数进行调优结果可知，L2正则更好，且超参数最佳值为0.1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl4VdW5x/HvmwHCDIEAYTIMUSAEUBBxrgpK1QoKVL2t0lutba9eW1txqNZ5oGKH21mkWu31OoAiKKggzlZBVOZREZnCIIjMY977x97BgCGckHOyz0l+n+fZ3dPa+7zbtnlda+29lrk7IiIilZUWdQAiIlI9KKGIiEhcKKGIiEhcKKGIiEhcKKGIiEhcKKGIiEhcKKGIiEhcKKGIiEhcKKGIiEhcZEQdQFVq1qyZ5+XlRR2GiEhK+fDDD79w95zDlatRCSUvL48ZM2ZEHYaISEoxs89jKacmLxERiQslFBERiQslFBERiYsa1YciIlJiz549rFy5kp07d0YdStLIysqiTZs2ZGZmHtH1SigiUiOtXLmSBg0akJeXh5lFHU7k3J0NGzawcuVK2rdvf0T3UJOXiNRIO3fupGnTpkomITOjadOmlaqxKaGISI2lZHKgyv7zUEIREYnRxQ+9x8UPvRd1GElLCSUG+h+RiCRC/fr1928PGDCAxo0bc/7555dZ9uqrr6Znz5507dqVOnXq0LNnT3r27MnYsWMr9JsfffQRL7/8cqXiPhR1youIJIHhw4ezfft2HnrooTLP/+UvfwFg2bJlnH/++cycOfOIfuejjz5i7ty5DBgw4IhjPRTVUGJQ9NUOVmzcHnUYIlKNnXXWWTRo0OCIrl2yZAnnnHMOvXr14rTTTmPx4sUAPPXUU3Tr1o0ePXpwxhlnsGPHDu666y6eeOKJI6rdHI5qKDHYuaeYd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SGK8BVwcTm6UA5wGTCeYgnVw2JfSgmAwxRILgE4A7v4pMAO4Mxz9FjPLL5kDxsyaAuvdfU9VPZDI4SihiCTGOGA2MAt4DbghbOJ6lmAOlLnAQwQzAX4VXjORAxPMlUBL4BMzmwM8zNdzpZwBpNzot1K9abRhkSpmZvXdfWtYy5gOnOzua8L5Kl4P9w/VGV9yj+eAm919URWELBITveUlUvVeDCc9qgXcHdZccPcdZnY7wZzyyw91cTgR1/NKJpJsVEMREZG4UB+KiIjEhRKKiIjEhRKKiIjEhRKKiIjEhRKKiIjEhRKKiIjExf8DZoo49kLww+UAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    plt.errorbar(x_axis, -test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    #plt.errorbar(x_axis, -train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "plt.legend()\n",
    "plt.xlabel( 'log(C)' )                                                                                                      \n",
    "plt.ylabel( 'Accuracy' )\n",
    "plt.savefig('LogisticGridSearchCV_C.png' )\n",
    "plt.show()\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "图像显示了L1，L2正则下，模型得分随着超参数的变化曲线，由此可知，L1，L2正则模型随着超参数的增大，模型效果越来越好。在L2正则下，当C=0.1，得分取得最优值。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
